<div id="gioithieu">
    	<div id="tieude_1">
       		<p>Tour Hot Nước Ngoài</p>
         </div>
         <div id="noidung_gt">     
 <?php

	$sql =  $mysqli->query ("SELECT MA_LOAI,qldl_chi_tiet_dat_tour.MA_TOUR, COUNT( qldl_chi_tiet_dat_tour.MA_TOUR ),qldl_tour.MA_TOUR, qldl_tour.HINH_ANH, qldl_tour.TEN_TOUR, qldl_tour.GIA,qldl_tour.TG_KHOI_HANH, qldl_tour.SO_NGAY,qldl_tour.SO_CHO
					FROM qldl_chi_tiet_dat_tour
					INNER JOIN qldl_tour ON qldl_chi_tiet_dat_tour.ma_tour = qldl_tour.ma_tour
					INNER JOIN qldl_chi_tiet_tour ON qldl_tour.ma_tour = qldl_chi_tiet_tour.ma_tour
					INNER JOIN qldl_dia_diem_du_lich ON qldl_dia_diem_du_lich.ma_dia_diem = qldl_chi_tiet_tour.ma_dia_diem
					INNER JOIN qldl_tinh_thanh_pho ON qldl_dia_diem_du_lich.ma_tp = qldl_tinh_thanh_pho.ma_tp
					INNER JOIN qldl_quoc_gia ON qldl_quoc_gia.ma_quoc_gia = qldl_tinh_thanh_pho.ma_quoc_gia
					WHERE ma_loai =2
					GROUP BY qldl_chi_tiet_dat_tour.MA_TOUR 
					order by qldl_chi_tiet_dat_tour.MA_TOUR
					LIMIT 0,5 ");
	  				// $result=mysql_query($sql);

   				while ($row = $sql->fetch_array()){
   					$sodem = $row['SO_NGAY']-1;
   					$date=strtotime($row['TG_KHOI_HANH']);
					$data =date('d-m-Y',$date);
   					$string  = "<ul class='list-tour'>";
   					$string .= "<li>";
   					$string .="<img src='admin/tour/upload/news/".$row['HINH_ANH']."'   width='150' height='120'/>";
   					$string .="<div class='info-tour'><b><a href='index.php?id=chitiet&page=".$row['MA_TOUR']."'&amp=".$row['MA_LOAI']."' >";
   					$string .= "<font style='text-transform:uppercase'>";
   					$string .= $row['TEN_TOUR']."</a></font></b><br />";
   					$string .= "<font color='#FF0000' face='Tahoma, Geneva, sans-serif' style='font-weight:bold;font-size:13pt'>".
					number_format($row['GIA'],0,",",".")."&nbspVNĐ</font><br/> <font style='font-size:13pt'>";
   					$string .= "<B>Khởi hành: </B>". $data."<br />
        			<B>Thời gian: </B> ".$row['SO_NGAY'] ."&nbsp;ngày&nbsp;". $sodem ."&nbsp;đêm <BR />
        			<b>Số chỗ còn lại: </b> <font color='#FF0000' face='Tahoma, Geneva, sans-serif' style='font-weight:bold;font-size:13pt'>" .$row['SO_CHO']."</font><br><B>Phương tiện: </B>";
                    echo $string;
					$sql_1=$mysqli->query("SELECT qldl_phuong_tien.TEN_PHUONG_TIEN
										FROM qldl_chi_tiet_phuong_tien
										INNER JOIN qldl_tour
										ON qldl_tour .ma_tour=qldl_chi_tiet_phuong_tien.ma_tour
										INNER JOIN qldl_phuong_tien 
										ON qldl_chi_tiet_phuong_tien.ma_phuong_tien = qldl_phuong_tien.ma_phuong_tien
										WHERE qldl_tour .ma_tour = '".$row['MA_TOUR']."'");
					while($row = $sql_1->fetch_array())
										{

					echo $row['TEN_PHUONG_TIEN'];

					if($sql->num_rows == 1){
											echo".";
										}
										else {
											echo",";
											echo"&nbsp;";
										}
					}


                echo "</font></div></li></ul><hr />";	
   }
?>
 	</div>
</div>